const defaultState = {
    loading: false, clientPriceCount: [], carrierPriceCount: [], clientList:[], carrierList:[]
};

export default function businessAnalysis(state = defaultState, action) {
    const {type, payload, error} = action;
    if (error === true) {
        return {...state, loading: false};
    }
    switch (type) {

        case 'LINE_PRICE.QUERY_CLIENT_PRICE':
            return {...state, clientPriceCount: [...payload]};
        case 'LINE_PRICE.QUERY_CARRIER_PRICE':
            return {...state, carrierPriceCount: [...payload]};
        case 'LINE_PRICE.GET_CLIENT':
            return {...state, clientList: [...payload]};
        case 'LINE_PRICE.GET_CARRIER':
            return {...state, carrierList: [...payload]};
        default:
            return state;
    }
}
